package com.leap.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;

@Data
@Schema(description = "对话类")
@TableName("message")
public class Message implements Serializable {

    private static final long serialVersionUID = 3L;

    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "主键id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @TableField("role")
    @Schema(description = "对话角色")
    private String role;

    @Schema(description = "对话内容")
    @TableField("content")
    private String content;

    public Message(String role, String content) {
        this.role = role;
        this.content = content;
    }
}
